#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = 'dong'

import re
from bs4 import BeautifulSoup


def create_province():

    soup = BeautifulSoup(open('province.html'), 'html.parser')

    option = soup.find_all('option')
    print option
    print option[0]
    for o in option:
        # print o.string
        # print o["value"]
        print "\'%s\': %s," % (o.string, o["value"])



    province_dict = {
        '北京': 1,
        '四川': 2,
        '江苏': 3,
        '上海': 4,
        '广东': 5,
        '山东': 6,
        '河北': 7,
        '浙江': 8,
        '陕西': 9,
        '安徽': 10,
        '重庆': 11,
        '湖北': 12,
        '河南': 13,
        '福建': 14,
        '天津': 15,
        '湖南': 16,
        '山西': 17,
        '江西': 18,
        '广西': 19,
        '辽宁': 20,
        '贵州': 21,
        '黑龙江': 22,
        '云南': 23,
        '甘肃': 24,
        '吉林': 25,
        '内蒙古': 26,
        '青海': 27,
        '海南': 28,
        '宁夏': 29,
        '新疆': 30,
        '西藏': 31,
    }


# with open('city.html', 'rb') as fd:
#     s = fd.read()
#     array = re.findall(r'\((.+?)\)', s)
#     print '['
#     for a in array:
#         print '    ['+a.decode('utf-8')+'], '
#     print ']'

city_list = [
    ["鄂尔多斯","26","441"],
    ["哈尔滨","22","343"],
    ["贵阳市","21","356"],
    ["沈阳市","20","365"],
    ["南宁市","19","379"],
    ["南昌市","18","393"],
    ["太原市","17","404"],
    ["长沙市","16","415"],
    ["开发区","15","429"],
    ["济南市","6","8"],
    ["宝山区","4","41"],
    ["万州区","11","61"],
    ["南京市","3","125"],
    ["广州市","5","142"],
    ["石家庄市","7","164"],
    ["杭州市","8","176"],
    ["合肥市","10","197"],
    ["西安市","9","187"],
    ["武汉市","12","213"],
    ["郑州市","13","229"],
    ["福州市","14","247"],
    ["成都市","2","3"],
    ["拉萨市","31","256"],
    ["乌鲁木齐","30","263"],
    ["固原市","29","278"],
    ["丰台区","1","1"],
    ["海口市","28","283"],
    ["西宁市","27","285"],
    ["呼和浩特","26","293"],
    ["长春市","25","304"],
    ["兰州市","24","313"],
    ["昆明市","23","327"],
    ["曲靖市","23","328"],
    ["嘉峪关","24","314"],
    ["吉林市","25","305"],
    ["包头市","26","294"],
    ["海北","27","286"],
    ["三亚市","28","284"],
    ["海淀区","1","2"],
    ["石嘴山","29","279"],
    ["阿克苏","30","264"],
    ["那曲","31","257"],
    ["自贡市","2","4"],
    ["厦门市","14","248"],
    ["洛阳市","13","230"],
    ["黄石市","12","214"],
    ["宝鸡市","9","188"],
    ["芜湖市","10","198"],
    ["宁波市","8","177"],
    ["秦皇岛市","7","165"],
    ["深圳市","5","143"],
    ["苏州市","3","126"],
    ["南岸区","11","62"],
    ["奉贤区","4","42"],
    ["青岛市","6","9"],
    ["津南","15","430"],
    ["株洲市","16","416"],
    ["大同市","17","405"],
    ["景德镇","18","394"],
    ["桂林市","19","380"],
    ["大连市","20","366"],
    ["六盘水","21","357"],
    ["齐齐哈尔","22","344"],
    ["牡丹江市","22","345"],
    ["遵义市","21","358"],
    ["鞍山市","20","367"],
    ["柳州市","19","381"],
    ["九江市","18","395"],
    ["阳泉市","17","406"],
    ["湘潭市","16","417"],
    ["南开","15","431"],
    ["烟台市","6","10"],
    ["闵行区","4","44"],
    ["合川区","11","63"],
    ["无锡市","3","127"],
    ["德阳市","2","103"],
    ["珠海市","5","144"],
    ["唐山市","7","166"],
    ["温州市","8","178"],
    ["蚌埠市","10","199"],
    ["咸阳市","9","189"],
    ["襄阳市","12","215"],
    ["开封市","13","231"],
    ["漳州市","14","249"],
    ["门头沟","1","5"],
    ["昌都","31","258"],
    ["吐鲁番","30","265"],
    ["银川市","29","280"],
    ["海南","27","287"],
    ["阿拉善盟","26","295"],
    ["白山市","25","306"],
    ["天水市","24","315"],
    ["保山市","23","329"],
    ["玉溪市","23","330"],
    ["金昌市","24","316"],
    ["辽源市","25","307"],
    ["乌兰察布","26","296"],
    ["果洛","27","288"],
    ["中卫市","29","281"],
    ["克拉玛依","30","266"],
    ["山南","31","259"],
    ["朝阳区","1","6"],
    ["泉州市","14","250"],
    ["安阳市","13","232"],
    ["十堰市","12","216"],
    ["渭南市","9","190"],
    ["马鞍山","10","200"],
    ["嘉兴市","8","179"],
    ["张家口市","7","167"],
    ["汕头市","5","145"],
    ["绵阳市","2","104"],
    ["镇江市","3","128"],
    ["荣昌县","11","64"],
    ["金山区","4","45"],
    ["淄博市","6","11"],
    ["塘沽","15","432"],
    ["衡阳市","16","418"],
    ["运城市","17","407"],
    ["新余市","18","396"],
    ["防城港","19","382"],
    ["锦州市","20","368"],
    ["安顺市","21","359"],
    ["大庆市","22","346"],
    ["鸡西市","22","347"],
    ["黔东南","21","360"],
    ["抚顺市","20","369"],
    ["梧州市","19","383"],
    ["赣州市","18","397"],
    ["晋中市","17","408"],
    ["岳阳市","16","419"],
    ["北辰","15","433"],
    ["泰安市","6","12"],
    ["浦东区","4","46"],
    ["忠县","11","65"],
    ["扬州市","3","129"],
    ["眉山市","2","105"],
    ["韶关市","5","146"],
    ["廊坊市","7","168"],
    ["湖州市","8","180"],
    ["淮北市","10","201"],
    ["延安市","9","191"],
    ["荆州市","12","217"],
    ["新乡市","13","233"],
    ["莆田市","14","251"],
    ["通州区","1","7"],
    ["日喀则","31","260"],
    ["博尔塔拉","30","267"],
    ["吴忠市","29","282"],
    ["玉树","27","289"],
    ["呼伦贝尔","26","297"],
    ["通化市","25","308"],
    ["武威市","24","317"],
    ["昭通市","23","331"],
    ["丽江市","23","332"],
    ["张掖市","24","318"],
    ["四平市","25","309"],
    ["通辽市","26","298"],
    ["海西","27","290"],
    ["克孜勒苏柯尔克孜","30","268"],
    ["阿里","31","261"],
    ["三明市","14","252"],
    ["濮阳市","13","234"],
    ["宜昌市","12","218"],
    ["榆林市","9","192"],
    ["铜陵市","10","202"],
    ["绍兴市","8","181"],
    ["衡水市","7","169"],
    ["河源市","5","147"],
    ["泸州市","2","106"],
    ["东城区","1","27"],
    ["南通市","3","130"],
    ["秀山县","11","66"],
    ["徐汇区","4","47"],
    ["潍坊市","6","13"],
    ["西青","15","434"],
    ["常德市","16","420"],
    ["长治市","17","409"],
    ["吉安市","18","398"],
    ["玉林市","19","384"],
    ["盘锦市","20","370"],
    ["黔西南","21","361"],
    ["鹤岗市","22","348"],
    ["双鸭山市","22","349"],
    ["毕节","21","362"],
    ["朝阳市","20","371"],
    ["贵港市","19","385"],
    ["宜春市","18","399"],
    ["晋城市","17","410"],
    ["邵阳市","16","421"],
    ["河东","15","435"],
    ["济宁市 ","6","14"],
    ["长宁区","4","48"],
    ["涪陵区","11","67"],
    ["常州市","3","131"],
    ["顺义区","1","28"],
    ["南充市","2","107"],
    ["梅州市","5","148"],
    ["保定市","7","170"],
    ["金华市","8","182"],
    ["安庆市","10","203"],
    ["铜川市","9","193"],
    ["荆门市","12","219"],
    ["焦作市","13","235"],
    ["南平市","14","253"],
    ["林芝","31","262"],
    ["喀什","30","269"],
    ["黄南","27","291"],
    ["乌海市","26","299"],
    ["白城市","25","310"],
    ["白银市","24","319"],
    ["思茅市","23","333"],
    ["临沧市","23","334"],
    ["平凉市","24","320"],
    ["延边","25","311"],
    ["赤峰市","26","300"],
    ["海东","27","292"],
    ["和田","30","270"],
    ["龙岩市","14","254"],
    ["鹤壁市","13","236"],
    ["鄂州市","12","220"],
    ["汉中市","9","194"],
    ["黄山市","10","204"],
    ["衢州市","8","183"],
    ["承德市","7","171"],
    ["惠州市","5","149"],
    ["内江市","2","108"],
    ["延庆县","1","29"],
    ["徐州市","3","132"],
    ["北碚区","11","68"],
    ["杨浦区","4","49"],
    ["枣庄市","6","15"],
    ["河北","15","436"],
    ["娄底市","16","422"],
    ["朔州市","17","411"],
    ["鹰潭市","18","400"],
    ["北海市","19","386"],
    ["营口市","20","372"],
    ["黔南","21","363"],
    ["七台河市","22","350"],
    ["佳木斯市","22","351"],
    ["铜仁","21","364"],
    ["阜新市","20","373"],
    ["钦州市","19","387"],
    ["萍乡市","18","401"],
    ["吕梁市","17","412"],
    ["郴州市","16","423"],
    ["东丽","15","437"],
    ["德州市","6","16"],
    ["嘉定区","4","50"],
    ["永川区","11","69"],
    ["连云港市","3","133"],
    ["西城区","1","30"],
    ["宜宾市","2","109"],
    ["汕尾市","5","150"],
    ["邢台市","7","173"],
    ["舟山市","8","184"],
    ["滁州市","10","205"],
    ["安康市","9","195"],
    ["孝感市","12","221"],
    ["三门峡","13","237"],
    ["宁德市","14","255"],
    ["伊犁","30","271"],
    ["兴安盟","26","301"],
    ["松原市","25","312"],
    ["酒泉市","24","321"],
    ["楚雄","23","335"],
    ["西双版纳","23","336"],
    ["庆阳市","24","322"],
    ["锡林郭勒盟","26","302"],
    ["塔城","30","273"],
    ["商丘市","13","238"],
    ["黄冈市","12","222"],
    ["商洛市","9","196"],
    ["宿州市","10","206"],
    ["台州市","8","185"],
    ["沧州市","7","174"],
    ["东莞市","5","151"],
    ["乐山市","2","110"],
    ["昌平区","1","31"],
    ["盐城市","3","134"],
    ["璧山县","11","70"],
    ["静安区","4","51"],
    ["威海市","6","17"],
    ["河西","15","438"],
    ["永州市","16","424"],
    ["临汾市","17","413"],
    ["上饶市","18","402"],
    ["贺州市","19","388"],
    ["本溪市","20","374"],
    ["伊春市","22","352"],
    ["绥化市","22","353"],
    ["丹东市","20","375"],
    ["河池市","19","389"],
    ["抚州市","18","403"],
    ["忻州市","17","414"],
    ["益阳市","16","425"],
    ["和平","15","439"],
    ["日照市","6","19"],
    ["虹口区","4","52"],
    ["开县","11","74"],
    ["淮安市","3","135"],
    ["怀柔区","1","32"],
    ["雅安市","2","111"],
    ["中山市","5","152"],
    ["邯郸市","7","175"],
    ["丽水市","8","186"],
    ["池州市","10","207"],
    ["咸宁市","12","223"],
    ["许昌市","13","239"],
    ["阿勒泰","30","274"],
    ["巴彦淖尔","26","303"],
    ["定西市","24","323"],
    ["大理","23","337"],
    ["德宏","23","338"],
    ["陇南市","24","324"],
    ["哈密","30","275"],
    ["漯河市","13","240"],
    ["随州市","12","224"],
    ["淮南市","10","208"],
    ["江门市","5","153"],
    ["平谷区","1","33"],
    ["泰州市","3","136"],
    ["遂宁市","2","113"],
    ["酉阳县","11","75"],
    ["青浦区","4","53"],
    ["莱芜市","6","20"],
    ["红桥","15","440"],
    ["张家界","16","426"],
    ["崇左市","19","390"],
    ["辽阳市","20","376"],
    ["黑河市","22","354"],
    ["海拉尔","26","443"],
    ["大兴安岭","22","355"],
    ["铁岭市","20","377"],
    ["来宾市","19","391"],
    ["怀化市","16","427"],
    ["滨州市","6","21"],
    ["普陀区","4","54"],
    ["渝中区","11","76"],
    ["达州市","2","114"],
    ["宿迁市","3","137"],
    ["密云县","1","35"],
    ["佛山市","5","154"],
    ["阜阳市","10","209"],
    ["恩施","12","225"],
    ["平顶山市","13","241"],
    ["昌吉","30","276"],
    ["临夏","24","325"],
    ["怒江","23","339"],
    ["迪庆","23","340"],
    ["甘南","24","326"],
    ["巴音郭楞","30","277"],
    ["驻马店市","13","242"],
    ["六安市","10","210"],
    ["阳江市","5","155"],
    ["房山区","1","36"],
    ["巴中市","2","115"],
    ["渝北区","11","77"],
    ["崇明县","4","55"],
    ["东营市","6","22"],
    ["湘西","16","428"],
    ["百色市","19","392"],
    ["葫芦岛","20","378"],
    ["襄樊市","12","442"],
    ["聊城市","6","23"],
    ["闸北区","4","58"],
    ["南川区","11","78"],
    ["广元市","2","116"],
    ["亦庄开发区","1","38"],
    ["湛江市","5","156"],
    ["宣城市","10","211"],
    ["周口市","13","243"],
    ["红河","23","341"],
    ["文山","23","342"],
    ["南阳市","13","244"],
    ["亳州市","10","212"],
    ["茂名市","5","157"],
    ["石景山区","1","39"],
    ["广安市","2","117"],
    ["梁平县","11","79"],
    ["松江区","4","59"],
    ["菏泽市","6","24"],
    ["临沂市","6","25"],
    ["黄浦区","4","60"],
    ["云阳县","11","80"],
    ["资阳市","2","118"],
    ["大兴区","1","40"],
    ["肇庆市","5","159"],
    ["信阳市","13","245"],
    ["济源市","13","246"],
    ["清远市","5","160"],
    ["宣武区","1","112"],
    ["阿坝州","2","121"],
    ["卢湾区","4","140"],
    ["彭水县","11","81"],
    ["大渡口","11","82"],
    ["南汇区","4","141"],
    ["攀枝花市","2","122"],
    ["潮州市","5","161"],
    ["揭阳市","5","162"],
    ["甘孜州","2","123"],
    ["巴南区","11","83"],
    ["綦江区","11","84"],
    ["凉山州","2","124"],
    ["云浮市","5","163"],
    ["城口县","11","85"],
    ["奉节县","11","86"],
    ["两江新","11","87"],
    ["江北区","11","88"],
    ["黔江区","11","89"],
    ["潼南县","11","90"],
    ["丰都县","11","91"],
    ["巫山县","11","92"],
    ["沙坪坝","11","93"],
    ["长寿区","11","94"],
    ["铜梁县","11","95"],
    ["垫江县","11","96"],
    ["巫溪县","11","97"],
    ["九龙坡","11","98"],
    ["江津区","11","99"],
    ["大足区","11","100"],
    ["武隆县","11","101"],
    ["石柱县","11","102"],
]



# for i in range(1, 32):
#     print city_list


data_list1 = {}
data_list2 = {}
data_list3 = {}
data_list4 = {}
data_list5 = {}
data_list6 = {}
data_list7 = {}
data_list8 = {}
data_list9 = {}
data_list10 = {}
data_list11 = {}
data_list12 = {}
data_list13 = {}
data_list14 = {}
data_list15 = {}
data_list16 = {}
data_list17 = {}
data_list18 = {}
data_list19 = {}
data_list20 = {}
data_list21 = {}
data_list22 = {}
data_list23 = {}
data_list24 = {}
data_list25 = {}
data_list26 = {}
data_list27 = {}
data_list28 = {}
data_list29 = {}
data_list30 = {}
data_list31 = {}


for i in city_list:
    # print i[0].decode('utf-8')
    # print i[1]
    # print i[2]
    if i[1] == '1':
        data_list1[i[0]]=i[2]
    elif i[1] == '2':
        data_list2[i[0]]=i[2]
    elif i[1] == '3':
        data_list3[i[0]]=i[2]
    elif i[1] == '4':
        data_list4[i[0]]=i[2]
    elif i[1] == '5':
        data_list5[i[0]]=i[2]
    elif i[1] == '6':
        data_list6[i[0]]=i[2]
    elif i[1] == '7':
        data_list7[i[0]]=i[2]
    elif i[1] == '8':
        data_list8[i[0]]=i[2]
    elif i[1] == '9':
        data_list9[i[0]]=i[2]
    elif i[1] == '10':
        data_list10[i[0]]=i[2]
    elif i[1] == '11':
        data_list11[i[0]]=i[2]
    elif i[1] == '12':
        data_list12[i[0]]=i[2]
    elif i[1] == '13':
        data_list13[i[0]]=i[2]
    elif i[1] == '14':
        data_list14[i[0]]=i[2]
    elif i[1] == '15':
        data_list15[i[0]]=i[2]
    elif i[1] == '16':
        data_list16[i[0]]=i[2]
    elif i[1] == '17':
        data_list17[i[0]]=i[2]
    elif i[1] == '18':
        data_list18[i[0]]=i[2]
    elif i[1] == '19':
        data_list19[i[0]]=i[2]
    elif i[1] == '20':
        data_list20[i[0]]=i[2]
    elif i[1] == '21':
        data_list21[i[0]]=i[2]
    elif i[1] == '22':
        data_list22[i[0]]=i[2]
    elif i[1] == '23':
        data_list23[i[0]]=i[2]
    elif i[1] == '24':
        data_list24[i[0]]=i[2]
    elif i[1] == '25':
        data_list25[i[0]]=i[2]
    elif i[1] == '26':
        data_list26[i[0]]=i[2]
    elif i[1] == '27':
        data_list27[i[0]]=i[2]
    elif i[1] == '28':
        data_list28[i[0]]=i[2]
    elif i[1] == '29':
        data_list29[i[0]]=i[2]
    elif i[1] == '30':
        data_list30[i[0]]=i[2]
    elif i[1] == '31':
        data_list31[i[0]]=i[2]


# print data_list1
# print data_list2
# print data_list3
# print data_list4
# print data_list5
# print data_list6
# print data_list7
# print data_list8
# print data_list9
# print data_list10
# print data_list11
# print data_list12
# print data_list13
# print data_list14
# print data_list15
# print data_list16
# print data_list17
# print data_list18
# print data_list19
# print data_list20
# print data_list21
# print data_list22
# print data_list23
# print data_list24
# print data_list25
# print data_list26
# print data_list27
# print data_list28
# print data_list29
# print data_list30
# print data_list31


# print 'def city_31(self, value):'
# print '    data = {'
# for k,v in data_list31.iteritems():
#     print "        '"+k.decode('utf-8'), "': "+ v +', '
# print '    }'
# print '    return data.get(value)'

# for r in range(1, 32):
# # #     # print 'data_list%s = {}' % r
# # #     print "elif i[1] == '{0}':".format(r)
# # #     print "    data_list{0}[i[0]]=i[2]".format(r, )
# # #     print 'print data_list%s' % r
#     print "print 'def city_{0}(self, value):'".format(r)
#     print "print '    data = {'"
#     print 'for k,v in data_list{0}.iteritems():'.format(r)
#     print """    print "        '" + k.decode('utf-8') + "': " + v + ', '"""
#     print "print '    }'"
#     print "print '    return data.get(value)'"
#     print "print '\\n'"


print 'def city_1(self, value):'
print '    data = {'
for k,v in data_list1.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_2(self, value):'
print '    data = {'
for k,v in data_list2.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_3(self, value):'
print '    data = {'
for k,v in data_list3.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_4(self, value):'
print '    data = {'
for k,v in data_list4.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_5(self, value):'
print '    data = {'
for k,v in data_list5.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_6(self, value):'
print '    data = {'
for k,v in data_list6.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_7(self, value):'
print '    data = {'
for k,v in data_list7.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_8(self, value):'
print '    data = {'
for k,v in data_list8.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_9(self, value):'
print '    data = {'
for k,v in data_list9.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_10(self, value):'
print '    data = {'
for k,v in data_list10.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_11(self, value):'
print '    data = {'
for k,v in data_list11.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_12(self, value):'
print '    data = {'
for k,v in data_list12.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_13(self, value):'
print '    data = {'
for k,v in data_list13.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_14(self, value):'
print '    data = {'
for k,v in data_list14.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_15(self, value):'
print '    data = {'
for k,v in data_list15.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_16(self, value):'
print '    data = {'
for k,v in data_list16.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_17(self, value):'
print '    data = {'
for k,v in data_list17.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_18(self, value):'
print '    data = {'
for k,v in data_list18.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_19(self, value):'
print '    data = {'
for k,v in data_list19.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_20(self, value):'
print '    data = {'
for k,v in data_list20.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_21(self, value):'
print '    data = {'
for k,v in data_list21.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_22(self, value):'
print '    data = {'
for k,v in data_list22.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_23(self, value):'
print '    data = {'
for k,v in data_list23.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_24(self, value):'
print '    data = {'
for k,v in data_list24.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_25(self, value):'
print '    data = {'
for k,v in data_list25.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_26(self, value):'
print '    data = {'
for k,v in data_list26.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_27(self, value):'
print '    data = {'
for k,v in data_list27.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_28(self, value):'
print '    data = {'
for k,v in data_list28.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_29(self, value):'
print '    data = {'
for k,v in data_list29.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_30(self, value):'
print '    data = {'
for k,v in data_list30.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'
print 'def city_31(self, value):'
print '    data = {'
for k,v in data_list31.iteritems():
    print "        '" + k.decode('utf-8') + "': " + v + ', '
print '    }'
print '    return data.get(value)'
print '\n'

